<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// $Id$
use think\Route;

$url = '.shsytour.local';
$manager_prefix = 'branch';
$web_prefix = 'index';
$user_prefix = 'user';
$api_prefix = 'api';

/**
 * 后台路由
 */
Route::domain($manager_prefix.$url, function(){
    //分公司管理员
    Route::rule('manager/:id/readinfo','branch/Manager/getReadInfo');
    Route::controller('manager','branch/Manager');
    //分公司会员管理
    Route::rule('usercontrol/:id/readinfo','branch/Usercontrol/getReadInfo');
    Route::controller('usercontrol','branch/Usercontrol');
    //分公司房车管理
    Route::rule('caravancontrol/:id/readinfo','branch/Caravancontrol/getReadInfo');
    Route::controller('caravancontrol','branch/Caravancontrol');
    //分公司营地管理
    Route::rule('campcontrol/:id/addcampmanager','branch/Campcontrol/getAddCampManager');
    Route::rule('campcontrol/:id/readinfo','branch/Campcontrol/getReadInfo');
    Route::rule('campcontrol/:id/editinfo','branch/Campcontrol/getEditInfo');
    Route::controller('campcontrol','branch/Campcontrol');
   	Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");
});
/**
 * 前台路由
 */
Route::domain($web_prefix.$url, function(){
    //验证图片
   	Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");
    //reserve预定流程
    Route::controller('reserve','index/Reserve');
    //filter筛选流程
    Route::controller('filter','index/Filter');
    //订单路由
    Route::controller('order','index/Order');
});
/**
 * api路由
 */
Route::domain($api_prefix.$url, function(){
    //测试1
    Route::rule('/','user/Api/index');
    //地区
    Route::rule('area','user/Area/getImport');
});
/**
 * 会员中心路由
 */
Route::domain($user_prefix.$url, function(){
	Route::controller('user','user/User');
  Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");
  //会员找回密码
  Route::controller('userforgotpwd','user/UserForgotPwd');
  //会员个人资料
  Route::controller('userinfo','user/UserInfo');
  //会员联系人
  Route::rule('contactinfo/:id/del','user/ContactInfo/delete');
  Route::resource('contactinfo','user/ContactInfo');
  //会员房车信息
  //Route::rule('caravaninfo/:id/del','user/CaravanInfo/delete');
  Route::controller('caravaninfo','user/CaravanInfo');
});

